-
Notifications
You must be signed in to change notification settings - Fork 435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FlxObject: fix overlapsPoint() if overlap is at x or y = 0 #1818
Conversation
…rlapping, when they should be. (Consider the example of a single pixel at 0,0: the former could would never register an overlap with the mouse, always looking for your position to be > 0 and < 1. Even though it's a float, it still gets updated to integer values when you move the mouse.) May seem trivial, but when you have a button at the edge of a full-screen game, it becomes important.
This seems to be causing a failure in
|
Thanks, I'll have a look. |
That's probably expected behaviour, if the mouse cursor is at 0,0 during the test, and the button is at 0,0. :) |
I just checked this with a screen magnifier and a Before mering though - this seems like the sort of thing that we should really have a unit test for, and that should also be pretty easy to test. |
…emove from the state afterwards so we don't double-add, while leaving the existing tests independent of having been add()ed.
I had noticed, because I had a bunch of buttons at the top of the screen that testers were complaining did not function well. I had thought I was somehow not understanding hitboxes correctly or something. When I finally dug into it I was thinking the same thing ;) Thanks for verifying...talk about being under the magnifying glass... :) Hopefully this test is sufficient. |
Super, it passed on Travis too, not just locally. (You never know ;) ) |
…l#1818) * The top and left edges of checked objects were not registering as overlapping, when they should be. (Consider the example of a single pixel at 0,0: the former could would never register an overlap with the mouse, always looking for your position to be > 0 and < 1. Even though it's a float, it still gets updated to integer values when you move the mouse.) May seem trivial, but when you have a button at the edge of a full-screen game, it becomes important. * Fix test by moving button out from under the cursor. * Add unit test for HaxeFlixel#1818. Also make the existing unit test remove from the state afterwards so we don't double-add, while leaving the existing tests independent of having been add()ed.
The top and left edges of checked objects were not registering as overlapping, when they should be. (Consider the example of a single pixel at 0,0: the former could would never register an overlap with the mouse, always looking for your position to be > 0 and < 1. Even though it's a float, it still gets updated to integer values when you move the mouse.)
May seem trivial, but when you have a button at the edge of a full-screen game, it becomes important.